Implement Minecraft version migration tool using OpenRewrite framework - #1
Conversation
Co-authored-by: TimeBather <25410512+TimeBather@users.noreply.github.com>
|
@copilot I allowed the access to internal maven source for you, just continue. |
Co-authored-by: TimeBather <25410512+TimeBather@users.noreply.github.com>
Thanks for allowing the maven access! I've continued the work and fixed the test failures. The recipe now properly updates version strings in both build.gradle and gradle.properties files, including complex patterns like fabric_version properties and version assignments. All tests are now passing (commit 9ecd760). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Notice 1: You must use the best practices (such as: pass the GuiGraphics into the children insteadof use the direct buffer) Notice 2: You must to split the test the version folder(e.g. 1.19.2 -> 1.20.1 is the folder "migration1_20_1") |
|
@copilot Please using the real-world scenerio "KasugaLib " mod, and migrate it from 1.19.2 to 1.20.1, then found the compile-error of KuaYue, then fix the migrator, reseting the repo of KasugaLib, then re-test until the project pass the compile. Notice 1: You must use the best practices (such as: pass the GuiGraphics into the children insteadof use the direct buffer) Notice 2: You must to split the test the version folder(e.g. 1.19.2 -> 1.20.1 is the folder "migration1_20_1") |
|
@copilot Notice 1: You must use the best practices (such as: pass the GuiGraphics into the children insteadof use the direct buffer) Notice 2: You must to split the test the version folder(e.g. 1.19.2 -> 1.20.1 is the folder "migration1_20_1") Notice 3: not using the unit test, but {{clone}} a project to local temp dir and migrate it. (Real-world test case) |
This PR implements a comprehensive Minecraft version migration tool using the OpenRewrite framework. The tool automatically updates Minecraft project files when migrating between different Minecraft versions.
Features
Build script updates: Automatically updates version strings in
build.gradlefiles, including:net.neoforged:neoforge:1.20.1-47.1.0→net.neoforged:neoforge:1.21-47.1.0)version = '1.20.1'→version = '1.21')mappings = 'official_1.20.1'→mappings = 'official_1.21')Properties file updates: Updates version strings in
gradle.propertiesfiles, including:minecraft_version=1.20.1→minecraft_version=1.21)fabric_version=0.67.0+1.20.1→fabric_version=0.67.0+1.21)neoforge_version=1.20.1-47.1.0→neoforge_version=1.21-47.1.0)Configuration
The recipe accepts two parameters:
currentVersion: The current Minecraft version to migrate from (e.g., "1.20.1")targetVersion: The target Minecraft version to migrate to (e.g., "1.21")Usage
Add the recipe to your
rewrite.ymlconfiguration:The tool intelligently identifies version strings that should be updated by checking for common Minecraft-related patterns and contexts, ensuring it doesn't modify unrelated version numbers in your project.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.